package cn.com.jslh.boarpro.util.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lenovo on 2018/3/23.
 */

public abstract class BaseRecycleAdapter<T>extends BaseQuickAdapter<T,BaseViewHolder>{
    private Context context;



    public BaseRecycleAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected abstract void convert(BaseViewHolder helper, T item);

    public void addData(List<T> t,boolean flag){
        if(flag){
            mData.clear();
            mData.addAll(0,t);
        }else {
            mData.addAll(t);
        }

    }

}
